package com.huawei.hwid.core.datatype;

import android.content.Context;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.Parcelable.Creator;
import com.huawei.hms.framework.network.restclient.hianalytics.HianalyticsData;
import com.huawei.hwid.core.d.b.e;
import com.huawei.hwid.core.d.m;
import com.huawei.hwid.f.g;
import java.util.ArrayList;
import org.json.JSONException;
import org.json.JSONObject;
import org.xmlpull.v1.XmlPullParser;

public class SiteListInfo implements Parcelable {
    public static final Creator<SiteListInfo> CREATOR = new Creator<SiteListInfo>() {
        public /* synthetic */ Object createFromParcel(Parcel parcel) {
            return a(parcel);
        }

        public /* synthetic */ Object[] newArray(int i) {
            return a(i);
        }

        public SiteListInfo a(Parcel parcel) {
            SiteListInfo siteListInfo = new SiteListInfo();
            siteListInfo.a = parcel.readInt();
            siteListInfo.b = parcel.readString();
            siteListInfo.c = parcel.readString();
            siteListInfo.d = parcel.readInt();
            siteListInfo.e = parcel.readInt();
            siteListInfo.f = parcel.readInt();
            siteListInfo.g = parcel.readInt();
            siteListInfo.h = parcel.readInt();
            siteListInfo.i = parcel.readString();
            siteListInfo.j = parcel.readInt();
            siteListInfo.k = parcel.readInt();
            siteListInfo.l = parcel.readString();
            parcel.readStringList(siteListInfo.t);
            siteListInfo.p = parcel.readInt();
            siteListInfo.q = parcel.readString();
            siteListInfo.r = parcel.readString();
            siteListInfo.u = parcel.readInt();
            siteListInfo.v = parcel.readInt();
            siteListInfo.w = parcel.readInt();
            siteListInfo.x = parcel.readInt();
            siteListInfo.y = parcel.readInt();
            return siteListInfo;
        }

        public SiteListInfo[] a(int i) {
            return new SiteListInfo[i];
        }
    };
    public static final String TAG = "SiteListInfo";
    private int A = -1;
    private int B = -1;
    private int C = 3;
    private String D = "";
    private int E = -1;
    private int a = 0;
    private String b = "";
    private String c = "";
    private int d = 0;
    private int e = 0;
    private int f = 0;
    private int g = 0;
    private int h = 0;
    private String i = "";
    private int j = 0;
    private int k = -1;
    private String l = "";
    private String m = "";
    private String n = "";
    private String o = "";
    private int p = -1;
    private String q = "";
    private String r = "";
    private String s = "";
    private ArrayList<String> t = new ArrayList();
    private int u = 0;
    private int v = 0;
    private int w = 0;
    private int x = 0;
    private int y = -1;
    private int z = -1;

    public static void a(Context context, XmlPullParser xmlPullParser, SiteListInfo siteListInfo, String str) {
        if (xmlPullParser != null && siteListInfo != null && str != null && "site".equals(str)) {
            String str2 = "";
            for (int i = 0; i < xmlPullParser.getAttributeCount(); i++) {
                if (xmlPullParser.getAttributeName(i).equals("id")) {
                    siteListInfo.a(siteListInfo.b(xmlPullParser.getAttributeValue(i)));
                } else if (xmlPullParser.getAttributeName(i).equals(HianalyticsData.DOMAIN)) {
                    try {
                        str2 = xmlPullParser.getAttributeValue(i);
                        e.b(TAG, "TAG_DOMAIN::=" + str2, false);
                        JSONObject jSONObject = new JSONObject(str2);
                        siteListInfo.m = m.a(jSONObject, "as").trim();
                        siteListInfo.n = m.a(jSONObject, "cas").trim();
                        siteListInfo.o = m.a(jSONObject, "tms").trim();
                        siteListInfo.q = "https://" + m.a(jSONObject, UserInfo.ADDRESS).trim() + "/rest.php";
                        siteListInfo.a("https://" + m.a(jSONObject, "wisedevice").trim());
                        siteListInfo.s = m.a(jSONObject, "qrs").trim();
                    } catch (JSONException e) {
                        e.b(TAG, "parseJSONArrayInfos JSONException: " + e.getClass().getSimpleName(), true);
                    } catch (Exception e2) {
                        e.b(TAG, "parseJSONArrayInfos Exception: " + e2.getClass().getSimpleName(), true);
                    }
                }
            }
        }
    }

    public int describeContents() {
        return 0;
    }

    public void writeToParcel(Parcel parcel, int i) {
        parcel.writeInt(this.a);
        parcel.writeString(this.b);
        parcel.writeString(this.c);
        parcel.writeInt(this.d);
        parcel.writeInt(this.e);
        parcel.writeInt(this.f);
        parcel.writeInt(this.g);
        parcel.writeInt(this.h);
        parcel.writeString(this.i);
        parcel.writeInt(this.j);
        parcel.writeInt(this.k);
        parcel.writeString(this.l);
        parcel.writeString(this.m);
        parcel.writeString(this.n);
        parcel.writeString(this.o);
        parcel.writeStringList(this.t);
        parcel.writeInt(this.p);
        parcel.writeString(this.q);
        parcel.writeString(this.r);
        parcel.writeInt(this.u);
        parcel.writeInt(this.v);
        parcel.writeInt(this.w);
        parcel.writeInt(this.x);
        parcel.writeInt(this.y);
    }

    public int a() {
        return this.a;
    }

    private void a(int i) {
        this.a = i;
    }

    public void a(String str) {
        this.r = str;
    }

    public String b() {
        return this.m;
    }

    public String c() {
        return this.n;
    }

    private int b(String str) {
        int i = 0;
        try {
            i = g.a(str);
        } catch (Exception e) {
            e.b(TAG, "e = " + e.getClass().getSimpleName(), true);
        }
        return i;
    }
}
